/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ComponenteEntidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Marilyn
 */
@Entity
@Table(name = "tiposervicio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tiposervicio.findAll", query = "SELECT t FROM Tiposervicio t"),
    @NamedQuery(name = "Tiposervicio.findByIdTipoServicio", query = "SELECT t FROM Tiposervicio t WHERE t.idTipoServicio = :idTipoServicio"),
    @NamedQuery(name = "Tiposervicio.findByTservTipo", query = "SELECT t FROM Tiposervicio t WHERE t.tservTipo = :tservTipo"),
    @NamedQuery(name = "Tiposervicio.findByTservDescripcion", query = "SELECT t FROM Tiposervicio t WHERE t.tservDescripcion = :tservDescripcion"),
    @NamedQuery(name = "Tiposervicio.findByTservEstado", query = "SELECT t FROM Tiposervicio t WHERE t.tservEstado = :tservEstado")})
public class Tiposervicio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idTipoServicio")
    private Integer idTipoServicio;
    @Size(max = 100)
    @Column(name = "tserv_Tipo")
    private String tservTipo;
    @Size(max = 45)
    @Column(name = "tserv_Descripcion")
    private String tservDescripcion;
    @Column(name = "tserv_Estado")
    private Boolean tservEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tiposervicio", fetch = FetchType.LAZY)
    private List<Viaje> viajeList;

    public Tiposervicio() {
    }

    public Tiposervicio(Integer idTipoServicio) {
        this.idTipoServicio = idTipoServicio;
    }

    public Integer getIdTipoServicio() {
        return idTipoServicio;
    }

    public void setIdTipoServicio(Integer idTipoServicio) {
        this.idTipoServicio = idTipoServicio;
    }

    public String getTservTipo() {
        return tservTipo;
    }

    public void setTservTipo(String tservTipo) {
        this.tservTipo = tservTipo;
    }

    public String getTservDescripcion() {
        return tservDescripcion;
    }

    public void setTservDescripcion(String tservDescripcion) {
        this.tservDescripcion = tservDescripcion;
    }

    public Boolean getTservEstado() {
        return tservEstado;
    }

    public void setTservEstado(Boolean tservEstado) {
        this.tservEstado = tservEstado;
    }

    @XmlTransient
    public List<Viaje> getViajeList() {
        return viajeList;
    }

    public void setViajeList(List<Viaje> viajeList) {
        this.viajeList = viajeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoServicio != null ? idTipoServicio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tiposervicio)) {
            return false;
        }
        Tiposervicio other = (Tiposervicio) object;
        if ((this.idTipoServicio == null && other.idTipoServicio != null) || (this.idTipoServicio != null && !this.idTipoServicio.equals(other.idTipoServicio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ComponenteEntidad.Tiposervicio[ idTipoServicio=" + idTipoServicio + " ]";
    }
    
}
